/*
* @Author: ZHELIHAO\fangshuqin
* @Date:   2018-05-15 17:48:04
* @Last Modified by:   ZHELIHAO\fangshuqin
* @Last Modified time: 2018-05-26 19:24:31
*/
{
	let EVENT_CLICK = Laya.Event.CLICK;

	class Info extends Sail.Scene{
		constructor (){
			super();
			this.init();
		}

		init() {
			console.log("初始化info");
			this.basics   = new Com.Info.Basics();
			this.property = new Com.Info.Property();
			this.rolenum  = new Com.Info.Rolenum();

			this.bg =  new Laya.Image("res/hall/bg.jpg");
            this.bg.centerX = 0;
            this.bg.centerY = 0;

            this.infoBoxall = new Laya.Box();
            this.infoBoxall.width = 1480;
            this.infoBoxall.hegiht = 610;
            this.infoBoxall.centerX = 0;
            this.infoBoxall.centerY = 0;

            let btnBack = new Laya.Image("res/info/btn_back.png");
                btnBack.on(EVENT_CLICK, this, this.goback);
                btnBack.left = 21;
                btnBack.top = 7;

            let btnClose = new Laya.Image("res/info/btn_close.png");
                btnClose.on(EVENT_CLICK, this, this.goback);
                btnClose.right = 21;
                btnClose.top = 7;

            this.btnBack = btnBack;
            this.btnClose = btnClose;

            this.addChildren( this.bg, this.btnBack, this.btnClose, this.infoBoxall);
            this.infoBoxall.addChildren(this.basics, this.property, this.rolenum );

            Sail.io.emit(GAME_CMDS.USE_INFO);  //用戶详细信息
            Sail.io.emit(GAME_CMDS.GETHEROLIST);     //用户拥有角色
            Sail.io.emit(GAME_CMDS.USERFIVEPROPERTY);     //用户五维属性
		}

		goback () {
            Laya.loader.load(ASSETS.HALL, Laya.Handler.create(null, function () {
                Sail.director.runScene(new Scene.Hall);
            }));
        }

		onExit () {
			this.basics.exit();
			this.property.exit();
			this.rolenum.exit();

        }

        onResize (width, height) {
        }


	}

	Sail.class(Info, "Scene.Info");
}